$(document).ready(function () { 
	$("#showcard1").click(function () { 
		var btn = $(this);
		var wxname = $("#wxname1").val();
		if (wxname  == '') {
			alertwin("请输入昵称");
			return;
		}
		var wxtel = $("#wxtel").val();
		if (wxtel  == '') {
			alertwin("请输入您的联系电话");
			return;
		}
		var info = $("#content").val();
			if (info == '') {
			alertwin("请输入内容");
			return;
		}
		var submitData = {
			title:wxname,
			tel:wxtel,
			content: info
		};
		/*$.post('/Mobile/Guestbook/add.html', submitData,
			function(data) {
				var data= $.parseJSON(data);
				if (data.status) {
					alertwin(data.msg);
					setTimeout('window.location.href=location.href',1000);
				return;
			}else{
				alertwin(data);
				return;
			}
		},
		"json")*/

		$.ajax({
				url: MADD,
				type:'POST',
				data:submitData,
				success:function(data){
					var data= $.parseJSON(data);
					if(data.status){
						alertwin(data.msg);
						setTimeout('window.location.href=location.href',1000);
					}else{
						alertwin(data.msg);
					}
				}
			});
			return false;
	}); 
	//

	//
	
	//
	$("#windowclosebutton").click(function () { 
		$("#windowcenter").slideUp(500);
	});
	//
	$("#alertwinclose").click(function () { 
		$("#windowcenter").slideUp(500);
	});
}); 
//
function alertwin(title){ 
	window.scrollTo(0, -1);
	$("#windowcenter").slideToggle("slow"); 
	$("#txt").html(title);
	setTimeout(function(){
		$("#windowcenter").slideUp(500);}
	,4000);
}
